package com.cy.ppj.dao.mapper.account;

import com.cy.ppj.model.domian.account.Commission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.BaseMapper;

import java.math.BigDecimal;

@Mapper
public interface CommissionMapper extends BaseMapper<Commission> {

    @Update(" UPDATE t_commission c SET c.taem_first_count=c.taem_first_count+#{teamFirstCount},c.taem_second_count=c.taem_second_count+#{teamSecondCount} WHERE c.user_id=#{userId} ")
    int addMemberCount(@Param("userId") Long userId, @Param("teamFirstCount") int teamFirstCount, @Param("teamSecondCount") int teamSecondCount);

    @Update(" UPDATE t_commission c SET c.amount=c.amount+#{amount} WHERE c.user_id=#{userId} ")
    int addAmount(@Param("userId") Long userId, @Param("amount") BigDecimal amount);
}
